package com.itheima.create;

/**
 * @author Anomaly
 * @date 2023/2/10 14:18
 */
public class RunnableDemo {
    public static void main(String[] args) {
        Runnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();
        for (int i = 0; i < 10000; i++) {
            System.out.println("主线程执行输出：" + i);
        }
    }
}

class MyRunnable implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.err.println("子线程执行输出：" + i);
        }
    }
}
